#pragma once
#include "Position.h"
#include "color.h"
#include "Texture.h"
#include "DrawableElement.h"
#include "Sketcher.h"

class CuadrangularObstacle : public DrawableElement{

private:
	Color * lineColor;
	Texture * texture;
	Color * elementColor;
	Position * position;
	Position * vertex1;
	Position * vertex2;
	Position * vertex3;
	Position * vertex4;
	float base;
	float altura;
	Collision * evaluateCollisionEdge(Ball * ball, Position * point1, Position * point2);
	Collision * evaluateCollisionVertex(Ball * ball, Position * point);
public:
	CuadrangularObstacle(void);

	virtual void setPosition(Position *position);

	virtual Position * getPosition();

	virtual Color * getElementColor();

	virtual void setElementColor( Color * color);

	virtual Color * getLineColor();

	virtual void setLineColor( Color * color);

	virtual Texture * getTexture();

	virtual void setTexture(Texture *texture);

	virtual void draw();

	virtual float getMinXPos();

	virtual float getMinYPos();

	virtual float getMaxXPos();

	virtual float getMaxYPos();

	virtual void evaluateCollision(Ball * ball);

public:
	~CuadrangularObstacle(void);
	void setBase( float base );
	void setAltura( float altura );
	float getAltura();
	float getBase();
	Position * getVertex1();
	Position * getVertex2();
	Position * getVertex3();
	Position * getVertex4();
	void setVertex1(Position * vertex);
	void setVertex2(Position * vertex);
	void setVertex3(Position * vertex);
	void setVertex4(Position * vertex);
};
